home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ELECTRON / 2687.ZIP / LS3.DOC < prev    next >
Text File  |  1990-06-25  |  26KB  |  673 lines

  1. 5.12 Macros - a way of simplifying logic network descriptions
  2.  
  3. When simulating complex logic  systems  it  is  essential  to  have  a  MACRO 
  4. facility which allows a previously defined logic network to be treated  as  a 
  5. module in its own right.  Three basic ideas are central to the macro concept, 
  6. these are:-
  7.  
  8. (1) A macro is essentially a stand alone network description with the relevant
  9.     input and output nodes specified in the definition of the macro.
  10.  
  11. (2) Once defined, a macro can be treated as a functional BLACK BOX and can be
  12.     used over and over again just by referencing it by name.   The LSYSTEM
  13.     compiler expands each macro which generates a list of the internal logic
  14.     components, ready for simulation.
  15.  
  16. (3) All circuit nodes defined within a macro definition are LOCAL, that is,
  17.     the actual node names used will not conflict with those used in the main
  18.     logic network or other macro definitions.
  19.     Each time a macro is invoked in the main logic network ( called like a
  20.     program subroutine ), UNIQUE versions of its internal node names are
  21.     automatically generated by the LSYSTEM compiler.
  22.  
  23. An unlimited number of macros can be defined for inclusion in  logic  network 
  24. descriptions.   Macros can be nested up to 20 levels deep, that is macros can 
  25. use other macros, which use other macros, which use other macros etc ....  up 
  26. to 20 levels.
  27.  
  28. 5.12.1    Defining and using macros
  29.  
  30. Once a macro has been defined its use is identical to that of a primitive.
  31.  
  32. Four essential rules MUST be adhered to when defining and using macros:-
  33.  
  34. (1)    A macro must be defined before it is used.
  35.  
  36. (2)    A macro cannot be defined inside a macro definition.
  37.        However, other macros can be invoked from inside a macro definition.
  38.  
  39. (3)    Clock primitives are NOT allowed within a macro definition.
  40.  
  41. (4)    Command statements, for example .PRINT or .TIME, are not allowed
  42.        within a macro definition.
  43.    
  44. To define a macro the internal logic network description  is  placed  between 
  45. the keywords .MACRO and .ENDM.  The macro start directive .MACRO is  followed 
  46. by a macro name, this is the macro reference name, and a  list  of  interface 
  47. nodes.   The macro definition  ends  with  the  end  directive  .ENDM.    For 
  48. example, a very simple macro defining a AND_OR functional element is:-
  49.  
  50.  
  51.             +----+
  52.        A ---I  & I 
  53.        B ---I    I--------+    AND_OR
  54.             +----+        I
  55.             +----+        I    +----+
  56.        C ---I  & I        +----I >= I
  57.        D ---I    I-------------I  1 I---------- F
  58.             +----+             +----+
  59.  
  60.                         I
  61.                         I
  62.                         I
  63.  
  64.                     +----------+
  65.              A -----I AND_OR   I    
  66.              B -----I          I
  67.              C -----I          I----- F
  68.              D -----I          I
  69.                     +----------+
  70.  
  71. In LSYSTEM syntax this macro could be written as:-
  72.  
  73.              .MACRO AND_OR A B C D F
  74.                     G1 A B N1 AND2
  75.                     G2 C D N2 AND2
  76.                     G3 N1 N2 F OR2
  77.              .ENDM
  78.  
  79. In this example definition nodes N1 and N2 are LOCAL  internal  nodes.    The 
  80. AND_OR macro just defined could then be used in the main network  description 
  81. or in another macro definition in exactly the same way as a  primitive  logic 
  82. component type would be.
  83.  
  84. Please note that when a macro is invoked (  called  ),  interface  nodes  are 
  85. parsed to it by POSITION and not by NAME.
  86.  
  87. For example, the main network description  for  a  logic  network  using  the 
  88. AND_OR macro twice, such as:-
  89.  
  90.                +----------+
  91.       IN1 -----I AND_OR   I
  92.       IN2 -----I          I  N1
  93.       IN3 -----I          I-----+
  94.       IN4 -----I          I     I
  95.                +----------+     I      +-----+
  96.                                 +------I  &  I
  97.                +----------+     +------I     I------- OUTF
  98.       IN5 -----I AND_OR   I     I      +-----+
  99.       IN6 -----I          I     I
  100.       IN7 -----I          I-----+
  101.       IN8 -----I          I  N2
  102.                +----------+
  103.  
  104. would be described as:-
  105.  
  106.                M1  IN1  IN2 IN3  IN4 N1  AND_OR
  107.                M2  IN5  IN6 IN7  IN8 N2  AND_OR
  108.                G1  N1  N2  OUT  AND2
  109.  
  110. The network description defined above, using the AND_OR  macro  twice,  could 
  111. itself have been defined as a macro,  so  that  it  could  be  treated  as  a 
  112. functional black box with eight inputs and one output.  Hence, a macro called 
  113. AND_OR_2, which uses the macro AND_OR twice:- 
  114.  
  115.               +-----------+
  116.        A -----I AND_OR    I
  117.        B -----I           I-------+   AND_OR_2
  118.        C -----I           I  N1   I
  119.        D -----I           I       I
  120.               +-----------+       I    +-----+
  121.                                   +----I  &  I
  122.               +-----------+       +----I     I-------  O
  123.        E -----I AND_OR    I N2    I    +-----+
  124.        F -----I           I-------+
  125.        G -----I           I
  126.        H -----I           I
  127.               +-----------+
  128.  
  129. would be defined as:-
  130.  
  131.               .MACRO AND_OR_2  A B C D E F G H O
  132.                      M1 A B C D N1 AND_OR
  133.                      M2 E F G H N2
  134.                      G1 N1 N2 O
  135.               .ENDM
  136.  
  137. NOTE how the AND_OR macro has been NESTED within the AND_OR_2  macro.    This 
  138. nesting process can be continued to 20 levels deep ( this example is  just  1 
  139. level deep ) which should be more than adequate for most purposes.
  140.  
  141. The logic network description using the AND_OR macro  twice,  given  earlier; 
  142. can now be defined in just one line, using the AND_OR_2 macro:-
  143.  
  144.  
  145.     M1 IN1 IN2 IN3 IN4 IN5 IN6 IN7 IN8 OUT AND_OR_2
  146.  
  147. Once expanded out by the LSYSTEM compiler, the resulting network  description 
  148. will be no different to that generated by not using  macros   and  the  logic 
  149. network repetitively described with logic primitives.
  150.  
  151.  
  152. Macro nested definitions or recursive calls are NOT allowed., for example:-
  153.  
  154.          CORRECT                             WRONG
  155.  
  156.          .macro one a b                      .macro two a b
  157.            g1 n1 n1 a nand2                         .macro one c d
  158.            g2 a b n1 nor2                             g1 n1 n1 c nand2
  159.          .endm                                        g2 a b n1 nor2
  160.          .macro two a b                             .endm
  161.            g3 a b n xor                             g3 a b n xor
  162.            g4 a b one                               g4 n b one
  163.          .endm                                .endm   
  164.  
  165. A final feature of macros worth remembering when defining  a  macro  concerns 
  166. the rise and fall time of different paths through the internal logic network.  
  167. In general each path will have a different rise and fall time, for example in 
  168. a D flip flop the D to Q path is likely to be  different  to  the  PRESET  or 
  169. CLEAR to Q path.  The individual delay times can be set by including,  within 
  170. a macro structure, non-inverting buffers with their rise and fall  times  set 
  171. to give the correct overall path delays.    The following example illustrates 
  172. the technique:-
  173.  
  174. * Asynchronous BCD counter.
  175. .LIB default.LIB
  176. *
  177. .macro jkff_cp_ne j clock k clear qn q preset 
  178. g1 clock clockn INV (delay = 3)
  179. ic1 clockn clear preset j k q qn jkff_cp_pe
  180. .endm
  181. .MACRO DECODE Q1 Q2 Q3 Q4 DOUT
  182. G1 Q1 O1 INV DELAY=1
  183. G3 Q3 O3 INV DELAY=1 
  184. G5 O1 Q2 O3 Q4 DOUT NAND4 (DELAY=6)
  185. .ENDM
  186. *
  187. GEN1  COUNT CLK0 100
  188. GEN2  CLOCK CLK0 PERIOD(200)
  189. GEN3  PRESET CLK1 PERIOD(50000)
  190. *
  191. IC1  COUNT CLOCK COUNT CLR NQ1 Q1 PRESET JKFF_CP_NE
  192. IC2  COUNT Q1    COUNT CLR NQ2 Q2 PRESET JKFF_CP_NE
  193. IC3  COUNT Q2    COUNT CLR NQ3 Q3 PRESET JKFF_CP_NE
  194. IC4  COUNT Q3    COUNT CLR NQ4 Q4 PRESET JKFF_CP_NE
  195. IC5 Q1 Q2 Q3 Q4 CLR DECODE
  196. *
  197. .TIME 7000 7000
  198. .PRINT COUNT PRESET CLR CLOCK Q1 Q2 Q3 Q4 
  199. .END
  200.  
  201. 5.13 Comments
  202.  
  203. Comments can be embedded into the logic network description file by beginning 
  204. the line they occupy with an asterisk ( * ).   Comments can also be  appended 
  205. to any line by preceding them with a semi-colon ( ; ).   Note  that  appended 
  206. comments are not passed on to any output files, whereas * delimited  comments 
  207. are.  Comments are simply ignored by the compilation stage of the  simulation 
  208. cycle.
  209.  
  210. A comment line, after the  delimiter,  may  contain  any  valid  alphanumeric 
  211. string, for example:-
  212.  
  213. *--- Network description of a 16bit shift register.
  214. *--- Using D type flip flops.
  215. ;++  THIS COMMENT WILL NOT BE PASSED TO THE OUTPUT FILES.
  216. *--- Default primitive library loaded.
  217. .lib default;      This is an appended comment.
  218. *--- Macro library loaded via include statement.
  219. .include default.mac
  220. *--- Excitation clocks.
  221. clo1 clock clk0 period(100) ; system clock with 100ns period.
  222. clo2 reset clk1 523 577 ; short pulse to initialize shift register stages.
  223. clo3 enable clk0 ; tri state output enable.
  224.  
  225. *--- Network description
  226. .
  227. .
  228. etc etc
  229. 6.   Compiling a logic network description
  230.  
  231.  
  232. 6.1  The compile command
  233.  
  234. Once the network description file has been created, using a text editor,  the 
  235. description must be COMPILED into a pure data format ready for input  to  the 
  236. LSYSTEM simulator.   Compilation, as detailed in section 4.2, is initiated by 
  237. entering:-
  238.  
  239.           C:\LSYSTEM> compile file[.NWK] [switches......] <ENTER>
  240.  
  241.  
  242. 6.2  Error and warning messages reported during compilation
  243.  
  244. Some  fatal  errors,  such  as  inability  to  open  the  specified   network 
  245. description file or insufficient memory  available,  just  display  an  error 
  246. message saying as  such  and  abort  compilation.    Most  minor  errors  and 
  247. warnings however, do not abort compilation immediately.   Warnings and errors 
  248. are added up during the first pass of the compiler and a decision is made  on 
  249. whether to execute the second ( final ) pass or not.
  250.  
  251. Errors and warnings are reported on the  video  screen  and  written  to  the 
  252. ".LST" file if requested by:-
  253.  
  254.    - Printing the line number and the file error found.
  255.    - Printing the line in error, with the error highlighted.
  256.    - Printing a arrowhead underneath the error for clarity.
  257.  
  258. An example error is:-
  259.  
  260.       0115 <4SHIFT.NWK> "Numerical value invalid"
  261.       G10 OE OE1 INV RISE=1O FALL=8
  262.  
  263. This error has been reported because the O used for the  1O  is  actually  an 
  264. letter O ( as in N, O, P, Q etc ) and not a number zero ( as in 0, 1 ,2 etc).  
  265. All error and warning message output is duplicated in the same format in  the 
  266. ".LST" error listing, when requested by a -L or a .LST command.
  267.  
  268.  
  269. 6.3  The information file -- file.INF
  270.  
  271. An information file with the extension ".INF" is always generated during  the 
  272. compilation phase of the LSYSTEM simulation cycle.  This  output  file  gives 
  273. information about the logic network statistics, including the number of nodes 
  274. , logic components, number of primitives loaded and so forth.
  275.  
  276. After an error free compilation the information file contains:-
  277.    
  278.    - Network description name.
  279.    - Number of source lines compiled.
  280.    - Number of nodes in network.
  281.    - Number of trace nodes.
  282.    - Number of logic components in network.
  283.    - Number of excitation clocks.
  284.    - Simulation length.
  285.    - Simulation display period.
  286.    - Number of primitives loaded.
  287.    - Number of macros loaded.
  288.    - Number of used macros.
  289.    - Highest macro nesting.
  290.  
  291.    - Complete node name table, with internal node numbers.
  292.    - Table of used primitives, with number of times used.
  293.    - Table of used macros, with internal reference numbers.
  294.  
  295. The information file can be used in conjunction with any  warnings  generated 
  296. at the simulation phase of the LSYSTEM simulation cycle to  trace  contending 
  297. nodes,  and  undriven  (  floating  )  inputs.    Warnings  reported  at  the 
  298. simulation stage reference nodes and logic elements by their internal numbers 
  299. and not by name, so this file is invaluable.
  300.  
  301. 7.   Simulating a digital logic network
  302.  
  303. 7.1  Prerequisites
  304.  
  305. A logic network description file must have been created  and  an  error  free 
  306. compilation performed to generate the necessary  data  files  needed  by  the 
  307. simulation stage of the LSYSTEM simulation cycle.
  308.  
  309. Simulate the network as specified in section 4.3 by entering:-
  310.  
  311.       C:\LSYSTEM> simulate file <ENTER>
  312.  
  313. 7.2  Interpreting the tabular results file -- file.RLT
  314.  
  315. The primary output file generated by a simulation has  the  extension  ".RLT" 
  316. and contains tabulated information representing each trace node change,  with 
  317. reference to time in nS.   Node states are output in the results file EITHER: 
  318. at the simulation display period time specified in the  network  description, 
  319. OR whenever the logical state of a trace  node  changes,  see  section  5.11.   
  320. Trace nodes are shown with four possible states:-
  321.  
  322.       0 -> Logical LOW.
  323.       1 -> Logical HIGH.
  324.       Z -> High impedance state.
  325.       X -> Indeterminate state ( startup or contention condition).
  326.  
  327. Warnings generated at simulation time are  embedded  within  the  node  state 
  328. table as and when they occur.
  329.  
  330.  
  331. 7.3  Errors and warnings reported at simulation time
  332.  
  333.  
  334. Errors and warnings generated at simulation time are minimal, since  many  of 
  335. the  problems  causing  errors,  such  as  undriven  nodes,  are  removed  at 
  336. compilation stage in the LSYSTEM simulation cycle.
  337.  
  338.  
  339. The warnings, with a typical example,  that are reported are:-
  340.  
  341. (1)  Output contention
  342.  
  343. * WARNING [17nS] - Output contention: Node  40 , f49 f67
  344.  
  345. Reports that two logic components are trying to drive  node  number  40  into 
  346. opposing states.
  347.  
  348.  
  349. (2)  Floating input node
  350.  
  351. * WARNING [100nS] - Floating input node:  f71 {JKFF_CP_NE}, N40
  352.  
  353. Reports that node 40 has gone into high impedance state  and  has  caused  an 
  354. input on a JK flip flop to float high.
  355.  
  356.  
  357. (3)  Simulation manually aborted
  358.  
  359. * WARNING - Simulation manually aborted at time : 3053nS
  360.  
  361. Reports simulation aborted by pressing <ESC>.  The results up to  this  point 
  362. are still valid.
  363.  
  364.  
  365. (5)  A node never assumed a logical state
  366.  
  367. * Warning - Node number 5 never assumed a logical state
  368.  
  369. This warning, for every node applicable, is given at the end of  the  results 
  370. listing.  It means  that  the  node  stayed  in  the  indeterminate  state  X 
  371. throughout the entire simulation period.   The logic element(s)  driving  the 
  372. node were either never excited by a  changing  input  node,  or  remained  in 
  373. contention the whole time.   Contention though would have  been  reported  as 
  374. above, when it occurred.
  375.  
  376.  
  377. (6) Network instability
  378.  
  379. In the case of a logic network which is unstable, LSYSTEM reports the time at 
  380. which the instability occurred, on screen in a separate window, then finishes.
  381.  
  382. 8.   Post simulation graphics processing of trace node waveforms
  383.  
  384.  
  385. 8.1  Prerequisites
  386.  
  387.  
  388. The network description must have been compiled  and  simulated  successfully 
  389. and your computer must include one of  the  graphics  adapters  specified  in 
  390. section 2.  The waveform graphics post processor, as described in  detail  in 
  391. section 4.4, is initiated by entering:-
  392.  
  393.      C:\LSYSTEM> waveform file [switches....] <ENTER>
  394.  
  395.  
  396. 8.2  Split screen display
  397.  
  398.  
  399. The graphical display starts in split screen mode.    The  top  half  of  the 
  400. screen contains a timing diagram format display of the results  data,  whilst 
  401. the bottom contains a window displaying  the  tabular  results  file.    This 
  402. allows direct comparison of both  forms  of  data  presentation.   The  split 
  403. screen mode can be toggled on and off using  function  key  F2  whilst  being 
  404. displayed.   The tabular results file is loaded by waveform into a buffer  at 
  405. the start of a display session.   If the results file is greater in size than 
  406. this buffer only those results which will fit in the  buffer  are  loaded  by 
  407. waveform.   The parameters in the .TIME statement should be changed  if  this 
  408. occurs.
  409.  
  410.  
  411.  
  412. 8.3  Waveform logic state presentation
  413.  
  414.  
  415. Four logical states are shown on the graphical display, they are:-
  416.  
  417.      ....XXXXXXX........    Pulse of HIGH Impedance state [RED].
  418.  
  419.      ....XXXXXXX........    Pulse of Indeterminate state [GREEN].
  420.         .......
  421.      ....     ..........    Pulse of HIGH state.
  422.  
  423.      ....    ...........    Pulse of LOW state.
  424.         ......
  425.  
  426. these state notations are equivalent to the Z, X, 1 and 0 notation  used  for 
  427. the tabulated results file.   Trace node states  are  represented  using  the 
  428. above notation in a graph format,  plotting  time  (  in  for  example  nS  ) 
  429. horizontally, against specified trace nodes vertically.
  430.  
  431. Several  user  commands  are  available  interactively  whilst  viewing   the 
  432. graphical results.  They are are listed in the following screen dump  of  the 
  433. waveform help screen.
  434.  
  435.             SEE PRINTED USER GUIDE FOR SCREEN DUMP
  436.                  [ OR YOUR COMPUTER SCREEN ]
  437.  
  438. 9.   A further example simulation
  439.  
  440. To demonstrate the processes discussed in earlier sections of this manual,  a 
  441. commented example network is presented next.  The  network  description  file 
  442. for this example is also included on the LSYSTEM master disks.   The  example 
  443. has been chosen to demonstrate as wide  a  range  of  the  available  LSYSTEM 
  444. functions as possible.   Functionally, the sample network describes an 8  bit 
  445. serial data transmitter.  Eight data bits are loaded and the  transmitted  as 
  446. an 11 bit serial data stream which has one start bit and two stop bits.
  447.  
  448.                     +--------------------+
  449.         B1 ---------I                    I
  450.         B2 ---------I                    I---------  OUTM
  451.         B3 ---------I                    I
  452.         B4 ---------I                    I
  453.         B5 ---------I                    I
  454.         B6 ---------I                    I
  455.         B7 ---------I                    I
  456.         B8 ---------I                    I
  457.                     I                    I
  458.      LOAD  --------OI                    I
  459.      TRANS --------OI                    I
  460.      RESET --------OI                    I--------- BUSY
  461.      CLOCK ---------I                    I
  462.                     +--------------------+  
  463.  
  464. The operation of the transmitter is as follows:-
  465.  
  466. 1- Reset by holding RESET low for a short period.
  467.    Reset state for transmitter output is logic 1.
  468. 2- Latch parallel data in by taking LOAD low for at least one clock
  469.    cycle (loads on rising edge).
  470. 3- Pulse TRANSMIT low to send 11 bit serial data, at bit rate = clock / 2,
  471.    made up as follows :-
  472.   
  473.                           0XXXXXXXX11
  474.      where 0 = start bit,
  475.            X = data bits,
  476.      and   1 = stop bits.
  477. 4- BUSY remains high whilst serial data is being transmitted.
  478. 5- TRANSMIT ignored during BUSY period.
  479. 6- LOAD ignored during BUSY period.
  480. 7- RESET clears asynchronously whenever applied.
  481. 8- A new LOAD/TRANSMIT sequence can occur as soon as BUSY
  482.    returns to an inactive (logic 0 ) state.
  483. 9.1  The transmitter network file -- SAMPLE.NWK
  484.  
  485. The sample network description file should be studied until all the important 
  486. factors are understood.   Note the way in which the logic  network  has  been 
  487. broken down into manageable portions with the use of macros.
  488.  
  489. * SAMPLE.NWK example file -- 8 bit serial data transmitter.
  490. *
  491. .lib default.lib; ** Standard SHAREWARE PRIMITIVES **
  492. *
  493. elc clocks CLK0 PERIOD(100) ; Main system clock.
  494. elc reset  CLK1 323 379 ; Single RESET pulse to initialise counter.
  495. elc trans clk1 1023 1523 2720 2803 
  496. *------------------------------------- transmit input pulse -- for sending
  497. *------------------------------------- data.
  498. elc load CLK1 577 777 2423 2533
  499. *-----------------------------  Load pulse -- for loading parallel data.
  500. elc B1 clk1 2400 ; Parallel data -- bit 1
  501. elc B2 clk1 2400 ;                  bit 2
  502. elc B3 clk0 2400 ;                  bit 3
  503. elc B4 clk0 2400 ;                  bit 4
  504. elc B5 clk0 2400 ;                  bit 5
  505. elc B6 clk1 2400 ;                  bit 6
  506. elc B7 clk1 2400 ;                  bit 7
  507. elc B8 clk1 2400 ;                  bit 8
  508. elc vcc  clk1 ; V+ power rail.
  509. elc gnd  clk0 ; zero volt power rail.
  510.  
  511. *-- 4 bit ring counter. Resetting to 1000
  512. *-- sequence:
  513. *  1000
  514. *  0100
  515. *  0010
  516. *  0001
  517. *  1000
  518. *  etc....
  519. *
  520. .macro 12ring clock reset qa qb qc qd qe qf qg qh qi qj qk ql vcc 
  521.   el_ring clock vcc reset  l  a na dff_cp_pe (rise=12 fall=13) 
  522.   el_ring clock reset vcc  a  b nb dff_cp_pe (rise=12 fall=13) 
  523.   el_ring clock reset vcc  b  c nc dff_cp_pe (rise=12 fall=13) 
  524.   el_ring clock reset vcc  c  d nd dff_cp_pe (rise=12 fall=13) 
  525.   el_ring clock reset vcc  d  e ne dff_cp_pe (rise=12 fall=13) 
  526.   el_ring clock reset vcc  e  f nf dff_cp_pe (rise=12 fall=13) 
  527.   el_ring clock reset vcc  f  g ng dff_cp_pe (rise=12 fall=13) 
  528.   el_ring clock reset vcc  g  h nh dff_cp_pe (rise=12 fall=13) 
  529.   el_ring clock reset vcc  h  i ni dff_cp_pe (rise=12 fall=13) 
  530.   el_ring clock reset vcc  i  j nj dff_cp_pe (rise=12 fall=13) 
  531.   el_ring clock reset vcc  j  k nk dff_cp_pe (rise=12 fall=13) 
  532.   el_ring clock reset vcc  k  l nl dff_cp_pe (rise=12 fall=13) 
  533.   el_ring nl a  qa and2 (delay=9) 
  534.   el_ring na b  qb and2 (delay=9) 
  535.   el_ring nb c  qc and2 (delay=9)
  536.   el_ring nc d  qd and2 (delay=9) 
  537.   el_ring nd e  qe and2 (delay=9) 
  538.   el_ring ne f  qf and2 (delay=9) 
  539.   el_ring nf g  qg and2 (delay=9) 
  540.   el_ring ng h  qh and2 (delay=9) 
  541.   el_ring nh i  qi and2 (delay=9) 
  542.   el_ring ni j  qj and2 (delay=9) 
  543.   el_ring nj k  qk and2 (delay=9) 
  544.   el_ring nk l  ql and2 (delay=9) 
  545. .endm
  546. *
  547. .macro 12BURST clock reset XMIT a b c d e f g h i j k l active vcc
  548. *-- Generates set of enable pulses for conversion
  549. *-- of parallel data to serial stream.
  550.   el_12burst reset n1 n2 and2 (delay = 9)
  551.   el_12burst xmit n5 inv (delay = 9)
  552.   el_12burst n5 n4 n7 or2 (delay = 9)
  553.   el_12burst clock nclock inv (delay = 9)
  554.   el_12burst n4 nclock n3 and2 (delay = 9)
  555.   el_12burst L n1 inv (delay = 9)
  556.   el_12burst clock n2 vcc n7 n4 not_n4 dff_cp_pe (delay = 9)
  557.   el_12burst N3 N4 a b c d e f g h i j k l vcc 12ring
  558.   el_12burst a active inv (delay = 9)
  559. .endm
  560.  
  561. .macro 8LATCH clock reset Nload a b c d e f g h  fa fb fc fd fe ff fg fh vcc
  562. *-- Nload LOW causes data to be latched in at next rise clk edge.
  563. *-- Data can be read always from outputs.
  564.   el_8latch nload not_1 inv (delay = 9)
  565.   el_8latch not_1 clock clk and2 (delay = 9)
  566.   el_8latch clk reset vcc a fa not_fa dff_cp_pe (rise=12 fall=13)
  567.   el_8latch clk reset vcc b fb not_fb dff_cp_pe (rise=12 fall=13)
  568.   el_8latch clk reset vcc c fc not_fc dff_cp_pe (rise=12 fall=13)
  569.   el_8latch clk reset vcc d fd not_fd dff_cp_pe (rise=12 fall=13)
  570.   el_8latch clk reset vcc e fe not_fe dff_cp_pe (rise=12 fall=13)
  571.   el_8latch clk reset vcc f ff not_ff dff_cp_pe (rise=12 fall=13)
  572.   el_8latch clk reset vcc g fg not_fg dff_cp_pe (rise=12 fall=13)
  573.   el_8latch clk reset vcc h fh not_fh dff_cp_pe (rise=12 fall=13)
  574. .endm
  575. *
  576. .macro TriSbuf in enable out
  577.   el_TriSbuf enable Nenable inv 
  578.   el_TriSbuf nenable in out tbuf
  579. .endm
  580. *
  581. *-- Transmitter
  582. *
  583. el clockS reset trans +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 ACT vcc 12burst
  584. el gnd +2  out triSbuf
  585. el a +3  out triSbuf
  586. el b +4  out triSbuf
  587. el c +5  out triSbuf
  588. el d +6  out triSbuf
  589. el e +7  out triSbuf
  590. el f +8  out triSbuf
  591. el g +9  out triSbuf
  592. el h +10  out triSbuf
  593. el vcc +11  out triSbuf;  ** Stop 1 **
  594. el vcc +12  out triSbuf;  ** Stop 2 **
  595. el vcc +1  out triSbuf  
  596. *
  597. el clockS NclockS inv (delay = 1)
  598. el NclockS vcc reset out outM not_outM dff_cp_pe; REALLY "SET" not reset.
  599. el clockS reset vcc active busy not_busy dff_cp_pe
  600. el vcc out res;   ** Pull up TRi-STATE o/ps **
  601. el clockS NCw inv (delay = 0)
  602. el NCw NCu inv (delay = 1)
  603. el NCw NCu ref and2 (delay = 1)
  604. el clockS reset load b1 b2 b3 b4 b5 b6 b7 b8 a b c d e f g h vcc 8latch
  605. *
  606. *
  607. .expand
  608. .time 10000 10000
  609. .print clockS reset ! load ! transmit ! ref ! busy !!!! outm !!!!!! 
  610. .print bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit8
  611. .end
  612.  
  613. Appendix A   Installing LSYSTEM on floppy disks
  614.  
  615. LSYSTEM is a disk intensive suite of computer programs.  If the computer  you 
  616. are using has  a hard disk or a high  density  floppy  disk  fitted  then  NO 
  617. problems with lack of disk space are likely to occur.  For  users  with  only 
  618. 360K DSDD floppy drives installed in their computer it is still  possible  to 
  619. run LSYSTEM but care must be taken over the available disk space.
  620.  
  621.  
  622. To install LSYSTEM on a 360K floppy  disk  system  the  following  steps  are 
  623. recommended:-
  624.  
  625. (1) Format a new 360K floppy disk.
  626.  
  627. (2) Make a directory called LSYSTEM on the formatted disk.
  628.  
  629. (3) Copy the following files from the LSYSTEM master  disks  to  the  LSYSTEM 
  630.     directory on the 360k floppy.
  631.  
  632.     COMPILE.EXE       LSM.BAT       CGA.BGI
  633.     SIMULATE.EXE      LS.BAT        EGAVGA.BGI
  634.     WAVEFORM.EXE                    HERC.BGI
  635.     DEFAULT.LIB
  636.  
  637.     You should find these files require slightly over 191K bytes of disk 
  638.     space.
  639.  
  640.  
  641. (4) Add to these files the example network file SAMPLE.NWK.
  642.  
  643. The 360K floppy is now a working LSYSTEM disk which can be used in either the 
  644. A or B drives.  To use the LSYSTEM in the B  drive,  make  the  B  drive  the 
  645. current drive and change directories to the LSYSTEM directory.   This  allows 
  646. LSYSTEM to be run by entering, for example
  647.  
  648.     B:\LSYSTEM> LSM SAMPLE, or
  649.  
  650.     B:\LSYSTEM> LS SAMPLE
  651.  
  652.  
  653. The example file SAMPLE.NWK, see page 38, generates a number of  files  which 
  654. require roughly 58K of disk space, leaving room on a 360K floppy for a number 
  655. of other library and macro files.  Take care not to exceed the available free 
  656. disk space by requesting large quantities of output results with badly chosen 
  657. .TIME statement parameters.
  658.  
  659.  
  660. Appendix B   The LSYSTEM primitive library file structure
  661.  
  662.              ONLY AVAILABLE  TO REGISTERED LSYSTEM USERS
  663.             
  664. Appendix C   LSYSTEM RAM primitives
  665.  
  666.              ONLY AVAILABLE TO REGISTERED LSYSTEM USERS
  667.  
  668.  
  669. Appendix  D  ROM primitives
  670.  
  671.              ONLY AVAILABLE TO REGISTERED LSYSTEM USERS
  672.              
  673.